pub mod common;
pub mod config;
pub mod git;
pub mod init;
mod page_template_helper;

use crate::errors::MyResult;
use crate::models::CliConfig;
use std::fs::File;
use std::io::BufReader;

pub struct Data {}

impl Data {
    pub fn load_config(config_path: &str) -> MyResult<CliConfig> {
        let file = File::open(config_path)?;
        let reader = BufReader::new(file);

        let config: CliConfig = serde_json::from_reader(reader)?;
        Ok(config)
    }
}
